ostree-repo-resolve-rev: Add function to accept a partial checksum
authorAnne LoVerso <aelv13@gmail.com>
Fri, 11 Jul 2014 18:00:45 +0000 (14:00 -0400)
committerAnne LoVerso <aelv13@gmail.com>
Fri, 18 Jul 2014 19:15:44 +0000 (15:15 -0400)
commitfd56952d6ba96056cf2c77e8d6031b42711849f5
tree917f3fb25a04530f68b432c7cba197a58120b11e
parent3645afc6d70fbe8817371152665a3b262f4c3dd9
ostree-repo-resolve-rev: Add function to accept a partial checksum

This patch adds a function that will parse a partial checksum when
resolving a refspec.  If the inputted refspec matches a truncated
existing checksum, it will return that checksum to be parsed.  If
multiple truncated checksums match the partial refspec, it is not
unique and will return false.  This addition is inspired by the same
functionality in Docker, which allows a user to reference a specific
commit without typing the entire checksum.

partial checksums: Add function to abstract comparison

This modifies the list_objects and list_objects_at functions
to take an additional argument for the string that a commit starts
with.  If this string arg is not null, it will only list commit
objects beginning with that string.  This allows for a new function
ostree_repo_list_commit_objects_starting_with to pass a partial string
and return a list of all matching commits.  This improves on the
previous strategy of listing refs because it will list all commit objects,
even ones in past history.  This update also includes bugfixes on
error handling and string comparison, and changes the output structure
of resolve_partial_checksum. The new strcuture will no longer return FALSE
without error.  Also, the hashtable foreach now uses iter.  Also
includes modified test file
src/libostree/ostree-repo-refs.c
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h
tests/test-basic.sh